import 'package:dy_download_utils/controller_dy.dart';
import 'package:dy_download_utils/manager_bt_channel.dart';
import 'package:dy_download_utils/page_home.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart';

void main() async {
  runApp(
    GetMaterialApp(
      home: App(),
      routingCallback: (routing) {},
      theme: ThemeData.light(),
      builder: (context, widget) {
        return MediaQuery(
          //设置文字大小不随系统设置改变
          data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
          child: widget!,
        );
      },
    ),
  );
}

class App extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    BtChannelManager.getInstance().initMessageHandler();
    EasyLoading.init();
    Get.put(DyController());
    return HomePage();
  }
}
